package com.ebelter.seneo.ui.fragments.addinfos;



import android.view.ViewTreeObserver;
import android.widget.LinearLayout;
import android.widget.TextView;
import com.ebelter.btcomlib.common.IOrder;
import com.ebelter.btcomlib.utils.ViewUtils;
import com.ebelter.seneo.R;
import com.ebelter.seneo.ui.activitys.SeneoAddInfoActivity;
import com.ebelter.seneo.ui.fragments.BaseFragment;
import com.ebelter.seneo.ui.views.birthday.Birthday;
import com.ebelter.seneo.ui.views.birthday.BirthdayView;


//填写密码
public class AddInfo_Birthday_Fragment extends BaseFragment  implements IOrder {




    BirthdayView birthdayView;

    TextView addinfo_birthday_tv;
    LinearLayout addinfo_birthday_ll;


    @Override
    protected int setLayoutResouceId() {
        return R.layout.addinfo_birthday_fly;
    }

    @Override
    protected void initView() {
        FV();
    }

    private void FV() {
        birthdayView=findViewById(R.id.birthdayView);
        birthdayView.setCurrentDate(1990,6,15);


       // ImageView br_iv=findViewById(R.id.br_iv);
        addinfo_birthday_tv=findViewById(R.id.addinfo_birthday_tv);
        addinfo_birthday_ll=findViewById(R.id.addinfo_birthday_ll);



        birthdayView.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
            @Override
            public void onGlobalLayout() {
                birthdayView.getViewTreeObserver().removeGlobalOnLayoutListener(this);
                birthdayView.setCurrentDate(1990, 6,15);
            }
        });
        adapterUi();
    }

    private void adapterUi() {
        if (getActivity()==null)return;
        if ( ((SeneoAddInfoActivity)getActivity()).currentCMD==SeneoAddInfoActivity.CMD_register){
            //注册界面 不需要改任何界面

        }else {
            // 添加用户信息界面
            ViewUtils.goneView(addinfo_birthday_tv);
            ViewUtils.setBottomMargin(addinfo_birthday_ll,90);
        }
    }
    @Override
    protected void setListener() {

    }

    @Override
    public void cmd(int cmd, Object... objects) {

    }

    public Birthday getBirthdayView(){
        return birthdayView.getBirthday();
    }
}
